import { Element } from '../../../fieldType'
import commonField from '../../../propertyPanel/commonConfig'
export const customerAddress = [
  {
    label: '省',
    value: 'province'
  },
  {
    label: '市',
    value: 'city'
  },
  {
    label: '区',
    value: 'area'
  },
  {
    label: '详细地址',
    value: 'detailAddress'
  }
]
export const customerRel = [
  {
    label: '联系人姓名',
    value: 'contactName'
  },
  {
    label: '电话',
    value: 'phone'
  },
  {
    label: '邮箱',
    value: 'contactEmail'
  }
]
export const fieldsMap = {
  oprate: '操作',
  contactName: '联系人姓名',
  phone: '电话',
  email: '邮箱',
  contactEmail: '邮箱',
  detailAddress: '详细地址',
  area: '区',
  city: '市',
  province: '省'
}
export interface AssociateSpareElement extends Element {
  displayField: any[],
  width: number,
  chooseRange: any[]
}
function formListFactory () {
  return [
    commonField.name,
    commonField.attrCode,
    { label: '选择内容', name: 'chooseRange', type: 'checkbox', data: [{ value: 1, label: '客户信息', disabled: true }, { value: 2, label: '联系人' }, { value: 3, label: '联系地址' }] },
    { label: '展示字段', name: 'displayField', type: 'slot' },
    commonField.width
  ]
}
const formList = formListFactory()
const formTemplate: AssociateSpareElement = {
  attrCode: '',
  businessId: '',
  name: '关联客户',
  chooseRange: [1],
  fieldType: 'associateUser',
  displayField: [],
  width: 1
}
export default {
  formList,
  formTemplate
}
